// index.js
import Stage from "./gp/stage";
import Billiards from "./billiards";
var canvas = null;
canvas = document.getElementById('album');
// 这里的宽高按实际情况设置
canvas.width = 375;
canvas.height = 667;
let stage = new Stage(canvas);
stage.start();

for (let i = 0; i < 16; i++) {
    let ball = new Billiards(i);
    stage.addChild(ball);
    ball.x = (i % 4) * 70 + 50;
    ball.y = Math.floor(i / 4) * 100 + 100;

    ball.scrollSpeed = (i + 1);

    let ax = i % 4;
    let ay = Math.floor(i / 4);

    let az = Math.sqrt(18 - ax * ax - ay * ay);
    let len = Math.sqrt(18);

    ball.scrollAxis = { x: ax / len, y: ay / len, z: az / len };
    console.log(ball.scrollAxis);
}